package DataStructure;

import java.io.PrintWriter;
import java.util.Scanner;

class Node
{	public int lb,ub,mid,lv;
	public Node left,right;
	
	public Node(int lb,int ub)
	{	this.lb=lb;this.ub=ub;this.mid=(int)((lb+ub)/2);
		this.lv=0;
		left=null;right=null;
	}
	public boolean isLeaf()
	{	if (left==null && right==null)
			return true;
		else
			return false;
	}
}
class Solver1028
{	int n,lb=0,ub=32000;
	int[] Rec,Ident,Rs;
	Node Tree;
	
	public void Input()
	{	Scanner in=new Scanner(System.in);
		n=in.nextInt();
		Rec=new int[n];
		Rs=new int[n];
		
		for (int i=0;i<=n-1;i++)
		{	int tmp=in.nextInt();
			Rec[i]=tmp;
			in.nextInt();
			
			Rs[i]=0;
		}
		Ident=new int[ub+1];
		for (int i=0;i<=ub;i++)
			Ident[i]=0;
	}
	private void RecursiveBuild(Node node,int lb,int ub)
	{	if (lb<ub)
		{	int mid=(int)((lb+ub)/2);
			node.left=new Node(lb,mid);
			node.right=new Node(mid+1,ub);
			RecursiveBuild(node.left,lb,mid);
			RecursiveBuild(node.right,mid+1,ub);
		}
	}
	private void BuildTree()
	{	Tree=new Node(lb,ub);
		RecursiveBuild(Tree,lb,ub);
	}
	private void RecursiveAddPoint(int x,int lvPoint,Node node)
	{	if (!node.isLeaf())
		{	if (x<=node.mid)
			{	node.right.lv++;
				RecursiveAddPoint(x,lvPoint,node.left);
			}
			else
			{	lvPoint+=node.right.lv;
				RecursiveAddPoint(x,lvPoint,node.right);
			}
		}
		else
		{	lvPoint+=Ident[x];
			Rs[lvPoint]++;
			Ident[x]++;
		}
	}
	public void Solve()
	{	BuildTree();
		for (int i=0;i<=n-1;i++)
			RecursiveAddPoint(Rec[i],0,Tree);
	}
	public void Output()
	{	PrintWriter out=new PrintWriter(System.out);
		for (int i=0;i<=n-1;i++)
			out.println(Rs[i]);
		out.flush();
	}
	public void main()
	{	Input();
		Solve();
		Output();
	}
}
public class P1028
{	public static void main(String[] args)
	{	Solver1028 solver=new Solver1028();
		solver.main();
	}
}
